home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / bash1135 / makefile < prev    next >
Makefile  |  1994-03-01  |  28KB  |  774 lines

  1. bindir=/bin
  2.  
  3. # This Makefile is automagically made from cpp-Makefile.  You should
  4. # not be editing this file; edit cpp-Makefile, machines.h, or
  5. # support/mksysdefs instead.  Then, assuming the edits were required
  6. # to compile Bash on your system, mail the changes you had to make to
  7. # bash-maintainers@ai.mit.edu.  We will do our best to incorporate
  8. # them into the next release.
  9.  
  10. # We would like you to use Bison instead of Yacc since some
  11. # versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  12. # this includes the Yacc currently being shipped with SunOS4.x.
  13. # If you do use Yacc, please make sure that any bugs in parsing
  14. # are not really manifestations of Yacc bugs before you report
  15. # them.
  16.  
  17. prefix = /usr
  18.  
  19. exec_prefix = $(prefix)
  20. bindir = /bin
  21. libdir = $(exec_prefix)/lib
  22.  
  23. manroot = $(prefix)/man
  24.  
  25. man1ext = 1
  26. man1dir = $(manroot)/man$(man1ext)
  27. mandir = $(man1dir)
  28. manext = $(man1ext)
  29.  
  30. infodir = $(prefix)/info
  31.  
  32. srcdir = .
  33. VPATH = $(srcdir)
  34.  
  35. # Here is a rule for making .o files from .c files that does not
  36. # force the type of the machine (like -"atarist") into the flags.
  37. .c.o:
  38.     $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
  39.  
  40. BISON = bison -y
  41.  
  42. CC = gcc $(GCC_EXTRAS)
  43.  
  44. # If the user has specified a Make shell, then use that.
  45.  
  46. SHELL=/bin/sh
  47.  
  48. RM = rm -f
  49. AR = ar
  50. COMPRESS = gzip
  51. COMPRESS_EXT = .gz
  52.  
  53. Machine = atarist
  54. OS = MiNT
  55.  
  56. BASEREL = -mbaserel
  57. ifdef BASEREL
  58. b = b
  59. endif
  60.  
  61. # PROFILE_FLAGS is either -pg, to generate profiling info for use
  62. # with gprof, or nothing (the default).
  63. PROFILE_FLAGS=
  64.  
  65. # This system has some peculiar flags that must be passed to the
  66. # the C compiler (or to cpp).
  67. SYSDEP = -DSTDC_HEADERS -DHAVE_BCOPY -DHAVE_UID_T -DMKFIFO_MISSING
  68.  
  69. # This system has the setlinebuf () call.
  70. LINEBUF = -DHAVE_SETLINEBUF
  71.  
  72. # This system has the vprintf () and vfprintf () calls.
  73. VPRINTF = -DHAVE_VFPRINTF
  74.  
  75. # This system has <unistd.h>.
  76.  
  77. UNISTD = -DHAVE_UNISTD_H
  78.  
  79. # This system has <stdlib.h>
  80.  
  81. STDLIB = -DHAVE_STDLIB_H
  82.  
  83. # This system has <limits.h>
  84.  
  85. LIMITSH = -DHAVE_LIMITS_H
  86.  
  87. # This system has multiple groups.
  88. GROUPS = -DHAVE_GETGROUPS
  89.  
  90. # This system has <sys/resource.h>
  91. RESOURCE = -DHAVE_RESOURCE
  92.  
  93. # The signal () call provided by the system returns a pointer to
  94. # a function returning void.  The signal handlers themselves are
  95. # thus void functions.
  96. SIGHANDLER = -DVOID_SIGHANDLER
  97.  
  98. # This system has the strerror () function.
  99. STRERROR = -DHAVE_STRERROR
  100.  
  101. # This system has <sys/wait.h>
  102. WAITH = -DHAVE_WAIT_H
  103.  
  104. # This system has the getwd () call.
  105. GETWD = -DHAVE_GETWD
  106.  
  107. # This system has a working version of dup2 ().
  108. DUP2 = -DHAVE_DUP2
  109.  
  110. # This system uses struct dirent for reading directories with readdir.
  111. DIRENT = -DHAVE_DIRENT
  112.  
  113. # This system has /usr/include/dirent.h
  114. DIRENTH = -DHAVE_DIRENT_H
  115.  
  116. # This system has /usr/include/string.h
  117. STRINGH = -DHAVE_STRING_H
  118.  
  119. # This system has /usr/include/varargs.h
  120. VARARGSH = -DHAVE_VARARGS_H
  121.  
  122. # This system has strchr () and strrchr () string functions.
  123. STRCHR = -DHAVE_STRCHR
  124.  
  125. ifeq (/dev/fd/0,$(wildcard /dev/fd/0))
  126. # This system has the /dev/fd directory for naming open files.
  127. DEVFD = -DHAVE_DEV_FD
  128. endif
  129.  
  130. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(STDLIB) $(LIMITSH) \
  131.        $(GROUPS) $(RESOURCE) \
  132.        $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) $(STRERROR) \
  133.        $(DIRENT) $(DIRENTH) $(STRINGH) $(VARARGSH) $(STRCHR) $(DEVFD) \
  134.        -D$(Machine) -D$(OS)
  135. DEBUG_FLAGS = $(PROFILE_FLAGS) -O2 -fomit-frame-pointer
  136. LDFLAGS    = $(NOSHARE) $(SYSDEP_LD) $(EXTRA_LD_PATH) $(DEBUG_FLAGS)
  137. override LDFLAGS += $(BASEREL)
  138. CFLAGS    = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
  139.       $(MALLOC_CFLAGS)
  140. CFLAGS += $(BASEREL)
  141. CPPFLAGS= -I. -I$(LIBSRC)
  142.  
  143. # The location of sources for the support libraries.
  144. LIBSRC = ./lib/
  145.  
  146. # Preface building with the full path of the current library source.
  147. LIBINC_DECL  = LIBINCDIR=`pwd`; export LIBINCDIR
  148. LIBINC_USAGE = $(subst %,$(shell pwd),-I% -I%/$(LIBSRC))
  149.  
  150. # Flags used when building libraries.
  151. LIBRARY_CFLAGS  = $(DEBUG_FLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
  152.           $(SYSDEP) $(DIRENT) $(DIRENTH) $(STRINGH) $(VARARGSH) \
  153.           $(PTEM) $(PTE) \
  154.           $(STRCHR) -D$(Machine) -D$(OS) $(UNISTD) $(LIMITSH) \
  155.           $(STDLIB) -DSHELL $(BASEREL)
  156.  
  157. # The compiler being used to build Bash can handle -L/library/path.
  158. SEARCH_LIB = -L
  159.  
  160. RL_LIBSRC = $(LIBSRC)readline/
  161. RL_LIBDOC = $(RL_LIBSRC)doc/
  162.  
  163. # The source, object and documentation of the GNU Readline library.
  164. READLINE_SOURCE    = $(RL_LIBSRC)rldefs.h $(RL_LIBSRC)readline.h \
  165.           $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)keymaps.h \
  166.           $(RL_LIBSRC)funmap.c $(RL_LIBSRC)emacs_keymap.c \
  167.           $(RL_LIBSRC)search.c $(RL_LIBSRC)vi_keymap.c \
  168.           $(RL_LIBSRC)keymaps.c $(RL_LIBSRC)parens.c \
  169.           $(RL_LIBSRC)vi_mode.c $(RL_LIBSRC)history.c \
  170.           $(RL_LIBSRC)readline.c $(RL_LIBSRC)tilde.c \
  171.           $(RL_LIBSRC)rltty.c $(RL_LIBSRC)complete.c \
  172.           $(RL_LIBSRC)bind.c $(RL_LIBSRC)isearch.c \
  173.           $(RL_LIBSRC)display.c $(RL_LIBSRC)signals.c \
  174.           $(RL_LIBSRC)posixstat.h $(RL_LIBSRC)tilde.h \
  175.           $(RL_LIBSRC)xmalloc.c
  176.  
  177. READLINE_OBJ    = $(RL_LIBSRC)readline.o $(RL_LIBSRC)funmap.o \
  178.           $(RL_LIBSRC)parens.o $(RL_LIBSRC)search.o \
  179.           $(RL_LIBSRC)keymaps.o $(RL_LIBSRC)history.o \
  180.           $(RL_LIBSRC)rltty.o $(RL_LIBSRC)complete.o \
  181.           $(RL_LIBSRC)bind.o $(RL_LIBSRC)isearch.o \
  182.           $(RL_LIBSRC)display.o $(RL_LIBSRC)signals.o \
  183.           $(RL_LIBSRC)tilde.o $(RL_LIBSRC)xmalloc.o
  184.  
  185. READLINE_DOC    = $(RL_LIBDOC)rlman.texinfo $(RL_LIBDOC)rluser.texinfo \
  186.           $(RL_LIBDOC)rltech.texinfo
  187.  
  188. READLINE_DOC_SUPPORT  = $(RL_LIBDOC)Makefile $(RL_LIBDOC)readline.dvi \
  189.           $(RL_LIBDOC)readline.info
  190.  
  191. # This has to be written funny to avoid looking like a C comment starter.
  192. READLINE_EXAMPLES = $(RL_LIBSRC)examples/[a-zA-Z]*.[ch] \
  193.             $(RL_LIBSRC)examples/Makefile $(RL_LIBSRC)examples/Inputrc
  194.  
  195. # Support files for GNU Readline.
  196. READLINE_SUPPORT = $(RL_LIBSRC)Makefile $(RL_LIBSRC)ChangeLog \
  197.            $(RL_LIBSRC)COPYING $(READLINE_EXAMPLES) \
  198.            $(READLINE_DOC_SUPPORT)
  199.  
  200. READLINE_CFLAGS = $(DEBUG_FLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
  201.           $(SYSDEP) -D$(Machine) -D$(OS) $(UNISTD) $(STDLIB) \
  202.           $(LIMITSH)
  203.  
  204. HIST_LIBSRC = $(LIBSRC)readline/
  205. HIST_LIBDOC = $(HIST_LIBSRC)doc/
  206.  
  207. HISTORY_CFLAGS = $(DEBUG_FLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
  208.          $(SYSDEP) -D$(Machine) -D$(OS) $(UNISTD) $(STDLIB) \
  209.          $(LIMITSH)
  210.  
  211. # The source, object and documentation of the history library.
  212. HISTORY_SOURCE    = $(HIST_LIBSRC)history.c $(HIST_LIBSRC)history.h
  213. HISTORY_OBJ    = $(HIST_LIBSRC)history.o
  214. HISTORY_DOC    = $(HIST_LIBDOC)hist.texinfo $(HIST_LIBDOC)hsuser.texinfo \
  215.           $(HIST_LIBDOC)hstech.texinfo
  216.  
  217. # Directory list for -L so that the link editor (ld) can find -lhistory.
  218.  
  219. GLOB_LIBSRC = $(LIBSRC)glob/
  220.  
  221. GLOB_SOURCE = $(GLOB_LIBSRC)glob.c $(GLOB_LIBSRC)fnmatch.c \
  222.           $(GLOB_LIBSRC)fnmatch.h
  223. GLOB_OBJ     = $(GLOB_LIBSRC)libglob.a
  224. GLOB_DOC     = $(GLOB_LIBSRC)doc/glob.texi $(GLOB_LIBSRC)doc/Makefile
  225. GLOB_SUPPORT = $(GLOB_LIBSRC)Makefile $(GLOB_LIBSRC)ChangeLog
  226.  
  227. GLOB_LDFLAGS = $(SEARCH_LIB)$(GLOB_LIBSRC)
  228.  
  229. GLOB_LIB     = -lglob
  230.  
  231. # The source, object and documentation for the GNU Tilde library.
  232. TILDE_LIBSRC = $(LIBSRC)tilde/
  233. TILDE_LIB = -ltilde
  234.  
  235. TILDE_SOURCE    = $(TILDE_LIBSRC)tilde.c $(TILDE_LIBSRC)tilde.h
  236. TILDE_OBJ    = $(TILDE_LIBSRC)tilde.o
  237. TILDE_DOC    = $(TILDE_LIBSRC)doc/tilde.texi $(TILDE_LIBSRC)doc/Makefile
  238. TILDE_SUPPORT    = $(TILDE_LIBSRC)Makefile $(TILDE_LIBSRC)ChangeLog
  239.  
  240. TILDE_LDFLAGS = $(SEARCH_LIB)$(TILDE_LIBSRC)
  241.  
  242. # Our malloc library.
  243.  
  244. BASHPOSIX_LIB     = $(LIBSRC)posixheaders/
  245. BASHPOSIX_SUPPORT = $(BASHPOSIX_LIB)posixstat.h $(BASHPOSIX_LIB)ansi_stdlib.h
  246.  
  247. # Declare all of the sources for the libraries that we have.
  248. LIBRARY_SOURCE  = $(READLINE_SOURCE) $(HISTORY_SOURCE) $(TERMCAP_SOURCE) \
  249.           $(GLOB_SOURCE) $(TILDE_SOURCE) $(MALLOC_SOURCE)
  250. LIBRARY_DOC    = $(READLINE_DOC) $(HISTORY_DOC) $(TERMCAP_DOC) $(GLOB_DOC) \
  251.           $(TILDE_DOC) $(MALLOC_DOC)
  252. LIBRARY_SUPPORT = $(READLINE_SUPPORT) $(HISTORY_SUPPORT) $(TERMCAP_SUPPORT) \
  253.           $(GLOB_SUPPORT) $(TILDE_SUPPORT) $(MALLOC_SUPPORT)
  254. LIBRARY_TAR     = $(LIBRARY_SOURCE) $(LIBRARY_DOC) $(LIBRARY_SUPPORT)
  255.  
  256. # You wish to compile with the line editing features installed.
  257. READLINE_LIB = -lreadline
  258.  
  259. # You only need termcap (or curses) if you are linking with GNU Readline.
  260.  
  261. TERMCAP_LIB = -l$btermcap
  262.  
  263. # Directory list for -L so that the link editor (ld) can find -lreadline.
  264.  
  265. READLINE_LDFLAGS = $(SEARCH_LIB)$(RL_LIBSRC) $(TERMCAP_LDFLAGS)
  266.  
  267. # The source and object of the bash<->readline interface code.
  268. RL_SUPPORT_SRC = bashline.c bracecomp.c
  269. RL_SUPPORT_OBJ = bashline.o $(BRACECOMP_OBJECT)
  270.  
  271. # The order is important.  Most dependent first.
  272.  
  273. LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) $(TILDE_LIB) $(MALLOC_LIB) $(LOCAL_LIBS)
  274.  
  275. READLINE_DEP = $(RL_LIBSRC)libreadline.a
  276.  
  277. GLOB_DEP = $(GLOB_LIBSRC)libglob.a
  278.  
  279. TILDE_DEP = $(TILDE_LIBSRC)libtilde.a
  280.  
  281. # Source files for libraries that Bash depends on.
  282. LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP) $(GLOB_DEP) $(HISTORY_DEP) $(TILDE_DEP) $(MALLOC_DEP)
  283.  
  284. # Rules for cleaning the readline and termcap sources.
  285.  
  286. LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(TILDE_LDFLAGS) \
  287.           $(GLOB_LDFLAGS) $(MALLOC_LDFLAGS)
  288.  
  289. # These are required for sending bug reports.
  290. SYSTEM_NAME = $(Machine)
  291. OS_NAME = $(OS)
  292.  
  293. # The name of this program.
  294. Program = bash
  295.  
  296. # The type of machine Bash is being compiled on.
  297. HOSTTYPE_DECL = -DHOSTTYPE='"$(SYSTEM_NAME)"'
  298.  
  299. # The default primary and secondary prompts.
  300. PPROMPT = '"${Program}\\$$ "'
  301. SPROMPT = '"> "'
  302.  
  303. bash_maintainer = bug-bash@prep.ai.mit.edu
  304. MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
  305.  
  306. # The group of configuration flags.  These are for shell.c
  307. CFG_FLAGS = -DPPROMPT=$(PPROMPT) -DSPROMPT=$(SPROMPT) -DOS_NAME='"$(OS_NAME)"'\
  308.         -DSYSTEM_NAME='"$(SYSTEM_NAME)"' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  309.  
  310. # The directory which contains the source for malloc.  The name must
  311. # end in a slash, as in "./lib/malloc/".
  312. ALLOC_DIR = ./lib/malloc/
  313.  
  314. # Our malloc.
  315.  
  316. ALLOCA_H_DEFINE =
  317.  
  318. ALLOCA_DEFINE = -DHAVE_ALLOCA
  319.  
  320. ALLOCA_CFLAGS = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
  321.  
  322. ALLOC_HEADERS = $(ALLOC_DIR)getpagesize.h
  323. ALLOC_FILES = $(ALLOC_DIR)malloc.c $(ALLOC_DIR)alloca.c $(ALLOC_DIR)xmalloc.c
  324.  
  325. # The location of ranlib on your system.
  326.  
  327. RANLIB = ranlib
  328.  
  329. # The source and object of the curly brace expansion and completion code.
  330. BRACES_SOURCE     = braces.c
  331. BRACECOMP_SOURCE = bracecomp.c
  332.  
  333. BRACES_OBJECT = braces.o
  334.  
  335. BRACECOMP_OBJECT = bracecomp.o
  336.  
  337. BUILTINS_LIB = builtins/libbuiltins.a
  338.  
  339. # The main source code for the Bourne Again SHell.
  340. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c \
  341.        dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \
  342.        expr.c copy_cmd.c flags.c subst.c hash.c mailcheck.c \
  343.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) $(BRACES_SOURCE) \
  344.        vprint.c input.c \
  345.        unwind_prot.c siglist.c getcwd.c $(RL_SUPPORT_SRC) error.c
  346.  
  347. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c \
  348.        general.h variables.h config.h $(ALLOC_HEADERS) alias.h maxpath.h \
  349.        quit.h machines.h posixstat.h filecntl.h unwind_prot.h parser.h \
  350.        command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
  351.        subst.h siglist.h
  352.  
  353. SOURCES     = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
  354.  
  355. # Matching object files.
  356. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
  357.        dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o \
  358.        expr.o flags.o jobs.o subst.o hash.o mailcheck.o test.o \
  359.        trap.o alias.o $(MALLOC) $(ALLOCA) $(BRACES_OBJECT) unwind_prot.o \
  360.        $(VPRINT_OBJ) input.o \
  361.        $(SIGLIST) $(GETCWD) version.o $(RL_SUPPORT_OBJ) $(BUILTINS_LIB)
  362.  
  363. # Where the source code of the shell builtins resides.
  364. DEFDIR = builtins/
  365. BUILTIN_DEFS = $(DEFDIR)alias.def $(DEFDIR)bind.def $(DEFDIR)break.def \
  366.            $(DEFDIR)builtin.def $(DEFDIR)cd.def $(DEFDIR)colon.def \
  367.            $(DEFDIR)command.def $(DEFDIR)declare.def $(LOAD_DEF) \
  368.            $(DEFDIR)echo.def $(DEFDIR)enable.def $(DEFDIR)eval.def \
  369.            $(DEFDIR)exec.def $(DEFDIR)exit.def $(DEFDIR)fc.def \
  370.            $(DEFDIR)fg_bg.def $(DEFDIR)hash.def $(DEFDIR)help.def \
  371.            $(DEFDIR)history.def $(DEFDIR)jobs.def $(DEFDIR)kill.def \
  372.            $(DEFDIR)let.def $(DEFDIR)read.def $(DEFDIR)return.def \
  373.            $(DEFDIR)set.def $(DEFDIR)setattr.def $(DEFDIR)shift.def \
  374.            $(DEFDIR)source.def $(DEFDIR)suspend.def $(DEFDIR)test.def \
  375.            $(DEFDIR)times.def $(DEFDIR)trap.def $(DEFDIR)type.def \
  376.            $(DEFDIR)ulimit.def $(DEFDIR)umask.def $(DEFDIR)wait.def \
  377.            $(DEFDIR)getopts.def $(DEFDIR)reserved.def $(DEFDIR)gem.def
  378. BUILTIN_C_CODE  = $(DEFDIR)mkbuiltins.c $(DEFDIR)common.c \
  379.           $(DEFDIR)hashcom.h $(DEFDIR)/bashgetopt.c $(GETOPT_SOURCE)
  380. GETOPT_SOURCE   = $(DEFDIR)getopt.c $(DEFDIR)getopt.h
  381. PSIZE_SOURCE    = $(DEFDIR)psize.sh $(DEFDIR)psize.c
  382. BUILTIN_SUPPORT = $(DEFDIR)Makefile $(DEFDIR)ChangeLog $(PSIZE_SOURCE) \
  383.           $(BUILTIN_C_CODE)
  384.  
  385. # Documentation for the shell.
  386. DOCDIR = ./documentation/
  387. BASH_TEXINFO = $(DOCDIR)*.texi $(DOCDIR)*.tex $(DOCDIR)texindex.c \
  388.             $(DOCDIR)*.dvi $(DOCDIR)Makefile
  389. BASH_MAN = $(DOCDIR)bash.1
  390. BASHDOCS = $(BASH_TEXINFO) $(BASH_MAN) INSTALL README RELEASE
  391. DOCUMENTATION = $(BASHDOCS) $(LIBRARY_DOC)
  392.  
  393. # Some example files demonstrating use of the shell.
  394.  
  395. EXAMPLES = examples/[a-zA-Z]*
  396.  
  397. ENDIAN_SUPPORT = endian.c
  398. ENDIAN_HEADER =
  399. ENDIAN_OUTPUT = endian.aux $(ENDIAN_HEADER)
  400.  
  401. SIGNAMES_SUPPORT = signames.c
  402. SIGNAMES_OUTPUT  = signames.aux signames.h
  403.  
  404. SUPPORT_SRC = $(srcdir)/support/
  405. SDIR = ./support/
  406. MKTARFILE = $(SDIR)mktarfile
  407. SCRIPTS_SUPPORT = $(SUPPORT_SRC)mksysdefs $(SUPPORT_SRC)cppmagic \
  408.           $(SUPPORT_SRC)cat-s $(MKTARFILE) $(SUPPORT_SRC)mail-shell \
  409.           $(SUPPORT_SRC)inform $(SUPPORT_SRC)/fixdist \
  410.           $(SUPPORT_SRC)mklinks $(SUPPORT_SRC)PORTING \
  411.           $(SUPPORT_SRC)/clone.bash
  412. FAQ = $(SUPPORT_SRC)FAQ
  413.  
  414. TEST_SUITE = ./test-suite/
  415. TEST_SUITE_SUPPORT = $(TEST_SUITE)[a-zA-Z0-9]*
  416.  
  417. CREATED_SUPPORT = $(ENDIAN_OUTPUT) $(SIGNAMES_OUTPUT) sysdefs.h \
  418.           $(SDIR)getcppsyms
  419.  
  420. SUPPORT = configure $(ENDIAN_SUPPORT) $(SIGNAMES_SUPPORT) $(SCRIPTS_SUPPORT) \
  421.       $(BUILTIN_SUPPORT) COPYING Makefile cpp-Makefile ChangeLog \
  422.       .distribution newversion.c $(EXAMPLES) $(SUPPORT_SRC)bash.xbm \
  423.       $(FAQ) $(SUPPORT_SRC)getcppsyms.c $(TEST_SUITE_SUPPORT)
  424.  
  425. # BAGGAGE consists of things that you want to keep with the shell for some
  426. # reason, but do not actually use; old source code, etc.
  427. BAGGAGE = longest_sig.c
  428.  
  429. # Things that the world at large needs.
  430. THINGS_TO_TAR = $(SOURCES) $(LIBRARY_TAR) $(BASHDOCS) $(SUPPORT) $(BAGGAGE)
  431.  
  432. all: .made
  433.  
  434. # Keep GNU Make from exporting the entire environment for small machines.
  435. .NOEXPORT:
  436.  
  437. .made: $(Program)
  438.     cp .machine .made
  439.  
  440. $(Program):  .build $(OBJECTS) $(LIBDEP) .distribution
  441.     $(CC) $(LDFLAGS) $(LIBRARY_LDFLAGS) -o $(Program) $(OBJECTS) $(LIBRARIES) -l$biio
  442.     -fixstk 10k $@
  443.  
  444. .build:    $(SOURCES) cpp-Makefile newversion.aux
  445.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  446.     @echo "$(Program) last made for a $(Machine) running $(OS)" >.machine
  447.  
  448. version.h:    newversion.aux
  449.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  450.  
  451. y.tab.c:    parse.y parser.h command.h input.h
  452.         -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
  453.         @echo expect 66 shift/reduce conflicts
  454.         $(BISON) -d parse.y
  455.         -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
  456.  
  457. $(RL_LIBSRC)libreadline.a: $(READLINE_SOURCE)
  458.     @echo Building in $(RL_LIBSRC) ...
  459.     $(MAKE) -C $(RL_LIBSRC) libreadline.a $(MFLAGS) \
  460.         CFLAGS='$(LIBRARY_CFLAGS) $(LIBINC_USAGE)' \
  461.         CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \
  462.         RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' RM='$(RM)'
  463.  
  464. $(GLOB_LIBSRC)libglob.a: $(GLOB_SOURCE)
  465.     @echo Building in $(GLOB_LIBSRC) ...
  466.     $(MAKE) -C $(GLOB_LIBSRC) libglob.a $(MFLAGS) \
  467.         CFLAGS='$(LIBRARY_CFLAGS) $(LIBINC_USAGE)' \
  468.         CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \
  469.         RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' RM='$(RM)'
  470.  
  471. ./lib/tilde/libtilde.a: $(TILDE_SOURCE)
  472.     @echo Building in $(TILDE_LIBSRC) ...
  473.     $(MAKE) -C $(TILDE_LIBSRC) libtilde.a $(MFLAGS) \
  474.         CFLAGS='$(LIBRARY_CFLAGS) $(LIBINC_USAGE)' \
  475.         CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \
  476.         RANLIB='$(RANLIB)' AR='$(AR)' CC='$(CC)' RM='$(RM)'
  477.  
  478. version.o:    version.h version.c
  479.  
  480. shell.o:      shell.h flags.h shell.c posixstat.h filecntl.h \
  481.               $(ENDIAN_HEADER) parser.h
  482.         $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
  483.  
  484. signames.h:   signames.aux
  485.         ./signames.aux $@
  486.  
  487. signames.aux:    signames.c
  488.         $(CC) $(CFLAGS) -o $@ signames.c
  489.  
  490. variables.o:  shell.h hash.h flags.h variables.h variables.c
  491.         $(CC) -c $(CFLAGS) $(HOSTTYPE_DECL) $(CPPFLAGS) variables.c
  492.  
  493. builtins/libbuiltins.a: $(BUILTIN_DEFS) $(BUILTIN_C_CODE) config.h
  494.     $(MAKE) -C $(DEFDIR) $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' \
  495.         CFLAGS='$(CFLAGS) $(LIBINC_USAGE) -I.' \
  496.         LDFLAGS='$(LDFLAGS)' RANLIB='$(RANLIB)' AR='$(AR)' \
  497.         CC='$(CC)' RM='$(RM)' DIRECTDEFINE='-D $(srcdir)/$(DEFDIR)'
  498.  
  499. builtins/builtext.h: builtins/libbuiltins.a
  500.  
  501. $(SDIR)bashbug: $(SDIR)bashbug.c version.h
  502.     -$(CC) $(CFLAGS) $(CFG_FLAGS) -o $(SDIR)bashbug $(SDIR)bashbug.c
  503.  
  504. copy_cmd.o: shell.h command.h hash.h
  505. copy_cmd.o: general.h variables.h config.h quit.h
  506. dispose_cmd.o: shell.h command.h
  507. dispose_cmd.o: general.h variables.h config.h quit.h
  508. error.o: error.h
  509. execute_cmd.o: shell.h command.h y.tab.h posixstat.h flags.h jobs.h
  510. execute_cmd.o: general.h variables.h config.h quit.h hash.h $(ENDIAN_HEADER)
  511. execute_cmd.o: unwind_prot.h siglist.h builtins/builtext.h
  512. expr.o: shell.h command.h hash.h
  513. expr.o: general.h variables.h config.h quit.h
  514. flags.o: flags.h config.h general.h quit.h
  515. general.o: shell.h command.h maxpath.h
  516. general.o: general.h variables.h config.h quit.h machines.h
  517. hash.o: shell.h command.h hash.h
  518. hash.o: general.h variables.h config.h quit.h
  519. jobs.o: shell.h command.h hash.h trap.h jobs.h siglist.h
  520. jobs.o: general.h variables.h config.h $(ENDIAN_HEADER) quit.h builtins/builtext.h
  521. mailcheck.o: posixstat.h maxpath.h variables.h
  522. mailcheck.o: hash.h quit.h
  523. make_cmd.o: shell.h command.h flags.h
  524. make_cmd.o: general.h variables.h config.h quit.h
  525. y.tab.o: shell.h command.h flags.h maxpath.h alias.h
  526. y.tab.o: general.h variables.h config.h quit.h
  527. print_cmd.o: shell.h command.h y.tab.h
  528. print_cmd.o: general.h variables.h config.h quit.h
  529. shell.o: shell.h command.h flags.h machines.h
  530. shell.o: general.h variables.h config.h quit.h
  531. shell.o: posixstat.h filecntl.h jobs.h input.h
  532. subst.o: shell.h command.h flags.h jobs.h siglist.h
  533. subst.o: general.h variables.h config.h $(ENDIAN_HEADER) quit.h
  534. test.o: posixstat.h
  535. trap.o: trap.h shell.h command.h hash.h unwind_prot.h signames.h
  536. trap.o: general.h variables.h config.h quit.h
  537. unwind_prot.o: config.h general.h unwind_prot.h
  538. variables.o: shell.h command.h hash.h flags.h
  539. variables.o: config.h general.h variables.h quit.h
  540. version.o: version.h .build
  541.  
  542. alias.o: ansi_stdlib.h
  543. bashline.o: ansi_stdlib.h
  544. variables.o: ansi_stdlib.h
  545. shell.o: ansi_stdlib.h
  546. error.o: ansi_stdlib.h
  547. hash.o: ansi_stdlib.h
  548. signames.o: ansi_stdlib.h
  549. expr.o: ansi_stdlib.h
  550. general.o: ansi_stdlib.h
  551. input.o: ansi_stdlib.h
  552.  
  553. braces.o: general.h shell.h variables.h quit.h config.h
  554. braces.o: maxpath.h unwind_prot.h command.h
  555.  
  556. bracecomp.o: bracecomp.c
  557. bracecomp.o: shell.h command.h hash.h builtins.h general.h variables.h
  558. bracecomp.o: quit.h alias.h
  559.  
  560. bracecomp.o: $(RL_LIBSRC)readline.h
  561.  
  562. bashline.o: shell.h command.h hash.h builtins.h
  563. bashline.o: general.h variables.h config.h quit.h alias.h
  564.  
  565. bashline.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
  566. y.tab.o: $(RL_LIBSRC)keymaps.h $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h
  567.  
  568. subst.o: $(HIST_LIBSRC)history.h
  569. bashline.o: $(HIST_LIBSRC)history.h
  570. y.tab.o: $(HIST_LIBSRC)history.h
  571.  
  572. subst.o: $(GLOB_LIBSRC)fnmatch.h
  573. execute_cmd.o: $(GLOB_LIBSRC)fnmatch.h
  574.  
  575. builtins/common.o: shell.h command.h config.h general.h error.h
  576. builtins/common.o: variables.h input.h hashcom.h siglist.h
  577. builtins/common.o: quit.h  unwind_prot.h maxpath.h jobs.h builtins.h
  578.  
  579. builtins/alias.o: command.h config.h error.h general.h maxpath.h
  580. builtins/alias.o: quit.h builtins/common.h
  581. builtins/alias.o: shell.h command.h unwind_prot.h variables.h 
  582. builtins/bind.o: command.h config.h error.h general.h maxpath.h quit.h 
  583. builtins/bind.o: shell.h unwind_prot.h variables.h 
  584. builtins/bind.o: builtins/bashgetopt.h
  585. builtins/break.o: command.h config.h error.h general.h maxpath.h
  586. builtins/break.o: quit.h 
  587. builtins/break.o: shell.h unwind_prot.h variables.h 
  588. builtins/builtin.o: command.h config.h error.h general.h maxpath.h
  589. builtins/builtin.o: quit.h builtins/common.h
  590. builtins/builtin.o: shell.h unwind_prot.h variables.h 
  591. builtins/cd.o: command.h config.h error.h general.h maxpath.h quit.h 
  592. builtins/cd.o: shell.h unwind_prot.h variables.h builtins/common.h
  593. builtins/command.o: command.h config.h error.h general.h maxpath.h
  594. builtins/command.o: quit.h builtins/bashgetopt.h
  595. builtins/command.o: shell.h unwind_prot.h variables.h 
  596. builtins/declare.o: command.h config.h error.h general.h maxpath.h
  597. builtins/declare.o: quit.h 
  598. builtins/declare.o: shell.h unwind_prot.h variables.h 
  599. builtins/echo.o: command.h config.h error.h general.h maxpath.h
  600. builtins/echo.o: quit.h 
  601. builtins/echo.o: shell.h unwind_prot.h variables.h 
  602. builtins/enable.o: command.h config.h error.h general.h maxpath.h
  603. builtins/enable.o: quit.h 
  604. builtins/enable.o: shell.h unwind_prot.h variables.h 
  605. builtins/eval.o: command.h config.h error.h general.h maxpath.h quit.h 
  606. builtins/eval.o: shell.h unwind_prot.h variables.h 
  607. builtins/exec.o: command.h config.h error.h general.h maxpath.h quit.h 
  608. builtins/exec.o: shell.h unwind_prot.h variables.h builtins/common.h
  609. builtins/exit.o: command.h config.h error.h general.h maxpath.h
  610. builtins/exit.o: quit.h
  611. builtins/exit.o: shell.h unwind_prot.h variables.h 
  612. builtins/fc.o: builtins.h command.h 
  613. builtins/fc.o: command.h config.h error.h general.h maxpath.h quit.h 
  614. builtins/fc.o: flags.h unwind_prot.h variables.h shell.h 
  615. builtins/fc.o: builtins/bashgetopt.h
  616. builtins/fg_bg.o: command.h config.h error.h general.h maxpath.h
  617. builtins/fg_bg.o: quit.h 
  618. builtins/fg_bg.o: shell.h unwind_prot.h variables.h 
  619. builtins/getopts.o: command.h config.h error.h general.h maxpath.h quit.h 
  620. builtins/getopts.o: shell.h unwind_prot.h variables.h 
  621. builtins/hash.o: builtins.h command.h 
  622. builtins/hash.o: command.h config.h error.h general.h maxpath.h quit.h 
  623. builtins/hash.o: shell.h unwind_prot.h variables.h builtins/common.h
  624. builtins/help.o: command.h config.h error.h general.h maxpath.h
  625. builtins/help.o: quit.h 
  626. builtins/help.o: shell.h unwind_prot.h variables.h 
  627. builtins/history.o: command.h config.h error.h general.h maxpath.h
  628. builtins/history.o: quit.h
  629. builtins/history.o: filecntl.h shell.h unwind_prot.h variables.h 
  630. builtins/inlib.o: command.h config.h error.h general.h maxpath.h quit.h 
  631. builtins/inlib.o: shell.h unwind_prot.h variables.h 
  632. builtins/jobs.o: command.h config.h error.h general.h maxpath.h
  633. builtins/jobs.o: quit.h builtins/bashgetopt.h
  634. builtins/jobs.o: shell.h unwind_prot.h variables.h 
  635. builtins/kill.o: command.h config.h error.h general.h maxpath.h
  636. builtins/kill.o: quit.h
  637. builtins/kill.o: shell.h trap.h unwind_prot.h variables.h 
  638. builtins/let.o: command.h config.h error.h general.h maxpath.h
  639. builtins/let.o: quit.h 
  640. builtins/let.o: shell.h unwind_prot.h variables.h 
  641. builtins/read.o: command.h config.h error.h general.h maxpath.h
  642. builtins/read.o: quit.h 
  643. builtins/read.o: shell.h unwind_prot.h variables.h 
  644. builtins/return.o: command.h config.h error.h general.h maxpath.h
  645. builtins/return.o: quit.h 
  646. builtins/return.o: shell.h unwind_prot.h variables.h 
  647. builtins/set.o: command.h config.h error.h general.h maxpath.h
  648. builtins/set.o: quit.h 
  649. builtins/set.o: shell.h unwind_prot.h variables.h 
  650. builtins/setattr.o: command.h config.h error.h general.h maxpath.h
  651. builtins/setattr.o: quit.h builtins/common.h builtins/bashgetopt.h
  652. builtins/setattr.o: shell.h unwind_prot.h variables.h 
  653. builtins/shift.o: command.h config.h error.h general.h maxpath.h
  654. builtins/shift.o: quit.h 
  655. builtins/shift.o: shell.h unwind_prot.h variables.h 
  656. builtins/source.o: command.h config.h error.h general.h maxpath.h
  657. builtins/source.o: quit.h 
  658. builtins/source.o: shell.h unwind_prot.h variables.h 
  659. builtins/suspend.o: command.h config.h error.h general.h maxpath.h
  660. builtins/suspend.o: quit.h
  661. builtins/suspend.o: shell.h unwind_prot.h variables.h 
  662. builtins/test.o: command.h config.h error.h general.h maxpath.h
  663. builtins/test.o: quit.h 
  664. builtins/test.o: shell.h unwind_prot.h variables.h 
  665. builtins/times.o: command.h config.h error.h general.h maxpath.h
  666. builtins/times.o: quit.h
  667. builtins/times.o: shell.h unwind_prot.h variables.h 
  668. builtins/trap.o: command.h config.h error.h general.h maxpath.h
  669. builtins/trap.o: quit.h builtins/common.h
  670. builtins/trap.o: shell.h unwind_prot.h variables.h 
  671. builtins/type.o: command.h config.h error.h general.h maxpath.h
  672. builtins/type.o: quit.h builtins/common.h
  673. builtins/type.o: shell.h unwind_prot.h variables.h 
  674. builtins/ulimit.o: command.h config.h error.h general.h maxpath.h
  675. builtins/ulimit.o: quit.h 
  676. builtins/ulimit.o: shell.h unwind_prot.h variables.h 
  677. builtins/umask.o: command.h config.h error.h general.h maxpath.h
  678. builtins/umask.o: quit.h 
  679. builtins/umask.o: shell.h unwind_prot.h variables.h 
  680. builtins/wait.o: command.h config.h error.h general.h maxpath.h
  681. builtins/wait.o: quit.h 
  682. builtins/wait.o: shell.h unwind_prot.h variables.h
  683. builtins/gem.o: command.h config.h error.h general.h maxpath.h
  684. builtins/gem.o: quit.h
  685. builtins/gem.o: shell.h unwind_prot.h variables.h 
  686.  
  687. builtins/mkbuiltins.o: ansi_stdlib.h
  688. builtins/fc.o: ansi_stdlib.h
  689.  
  690. $(Program).tar: $(THINGS_TO_TAR) .distribution
  691.     @$(MKTARFILE) $(Program) `cat .distribution` $(THINGS_TO_TAR)
  692.  
  693. $(Program).tar$(COMPRESS_EXT):    $(Program).tar
  694.         $(COMPRESS) < $(Program).tar > $@
  695.  
  696. clone:        $(THINGS_TO_TAR)
  697.         @$(MKTARFILE) +notar $(Machine) $(OS) $(THINGS_TO_TAR)
  698.  
  699. install:    .made
  700.         -if [ -f $(bindir)/$(Program) ]; \
  701.           then mv $(bindir)/$(Program) $(bindir)/$(Program).old; \
  702.         fi
  703.         install -s $(Program) $(bindir)/$(Program)
  704.         $(RM) installed-$(Program)
  705.         -ln -s $(bindir)/$(Program) installed-$(Program)
  706. install-doc:
  707.         $(MAKE) -C $(DOCDIR) $(MFLAGS) mandir=$(mandir) infodir=$(infodir) $@
  708.  
  709. mailable:    distribution
  710.         /bin/rm -rf uuencoded
  711.         mkdir uuencoded
  712.         $(SHELL) -c 'f=$(Program)-`cat .distribution`.tar.Z;uuencode $$f $$f | split -800 - uuencoded/$$f.uu.'
  713.  
  714. .distribution:
  715.         ./newversion.aux -dist `$(Program) -c 'echo $$BASH_VERSION'`
  716.  
  717. distribution:    $(Program) $(Program).tar$(COMPRESS_EXT) .distribution
  718.         @echo cp $(Program).tar$(COMPRESS_EXT) \
  719.             $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
  720.         @cp $(Program).tar$(COMPRESS_EXT) \
  721.             $(Program)-`cat .distribution`.tar$(COMPRESS_EXT)
  722.  
  723. newversion.aux:    newversion.c
  724.         $(CC) $(CFLAGS) -o newversion.aux newversion.c -l$bm
  725.  
  726. newversion:    newversion.aux
  727.         $(RM) .build
  728.         ./newversion.aux -dist
  729.         mv -f newversion.h version.h
  730.         $(MAKE) $(MFLAGS)
  731.  
  732. documentation:  documentation-force
  733.         $(MAKE) -C $(DOCDIR) $(MFLAGS)
  734.  
  735. documentation-force:
  736.  
  737. tags:        $(SOURCES) $(BUILTIN_C_CODE) $(LIBRARY_SOURCE)
  738.         etags $(SOURCES) $(BUILTIN_C_CODE) $(LIBRARY_SOURCE)
  739.  
  740. INDEX:        $(SOURCES) $(BUILTIN_C_CODE) $(LIBRARY_SOURCE)
  741.         ctags -x $(SOURCES) $(BUILTIN_C_CODE) $(LIBRARY_SOURCE) > $@
  742.  
  743. clean:
  744.         $(RM) $(OBJECTS) $(Program) ansi-Makefile *.aux
  745.         $(RM) .build .made version.h
  746.         $(RM) $(CREATED_SUPPORT) bash-Makefile
  747.         $(MAKE) -C $(DOCDIR) $(MFLAGS) clean
  748.         $(MAKE) -C builtins $(MFLAGS) clean
  749.         $(MAKE) -C $(RL_LIBSRC) $(MFLAGS) clean
  750.         $(MAKE) -C $(GLOB_LIBSRC) $(MFLAGS) clean
  751.         $(MAKE) -C $(TILDE_LIBSRC) $(MFLAGS) clean
  752.  
  753. distclean:    clean
  754. realclean:    clean
  755.         $(RM) y.tab.c y.tab.h
  756.  
  757. # Here is a convenient rule when you arrive at a new site and wish to
  758. # install bash on several different architectures.  It creates a new
  759. # directory to hold the results of compilation.  The directory is
  760. # named Machine-OS.
  761. architecture: $(Machine)-$(OS)/$(Program)
  762.  
  763. $(Machine)-$(OS):
  764.     -mkdir $(Machine)-$(OS)
  765.  
  766. $(Machine)-$(OS)/$(Program): $(Machine)-$(OS) $(Program)
  767.     mv $(Program) $(Machine)-$(OS)
  768.     mv sysdefs.h $(Machine)-$(OS)
  769.     mv $(SDIR)getcppsyms $(Machine)-$(OS)
  770.     $(MAKE) $(MFLAGS) clean
  771.  
  772. DEFINES: config.h cpp-Makefile sysdefs.h
  773.     echo $(CFLAGS) $(CPPFLAGS) >DEFINES
  774.